package com.ftg.learn.mapper;
import com.ftg.learn.pojo.Qizu;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface QizuMapper {
    //查找全部
    @Select("select * from qizu limit #{arg0},#{arg1}")
    public List<Qizu> showall(int begin, int end);
    //查一
    @Select("select * from qizu where qizu_id = ifnull(concat(#{qizu_id},%),qizu_id) or qizu_bt = ifnull(concat(#{qizu_bt},%),qizu_bt")
    public List<Qizu> findone(String qizu_id, String qizu_bt);
    //共多少条
    @Select("select count(*) from qizu")
    int getcount();
    //添加
    @Insert("insert into qizu(qizu_id,qizu_bt,qizu_nr,qizu_img)values(#{qizu_id},#{qizu_bt},#{qizu_nr},#{qizu_img})")
    public int add(Qizu qizu);
    //删除
    @Delete("delete from qizu where qizu_id = #{qizu_id}")
    public int delete(String qizu_id);
    @Update("update qizu set qizu_id = #{qizu_id},qizu_bt = #{qizu_bt},qizu_nr = #{qizu_nr},qizu_img = #{qizu_img}")
    public int update(Qizu qizu);
}
